<template>
	<view>
		<view class="topBox">
			<u-row>
				<u-col span="2">
					<view v-if="isBack" class="topLeftButton">
						<u-icon name="arrow-left" size="40" @tap="toBack"></u-icon>
					</view>
				</u-col>
				<u-col span="8">
					<view class="pageTitle"> {{pageTitle}}</view>
				</u-col>
				<u-col span="2">
				</u-col>
			</u-row>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: {
			pageTitle: String,
			isBack: false,
		},
		methods: {
			/**
			 * 返回上一页
			 */
			toBack() {
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss">
	.topBox {
		line-height: 100upx;
		width: 100%;
		background-color: #FFFFFF;
		text-align: center;
		z-index: 999;
	}

	.topLeftButton {
		margin-left: 10upx;
	}

	.pageTitle {
		color: #000;
		font-size: 32upx;
		font-weight: 500;
		text-align: center;
	}
</style>